package com.pro.mapper;

import com.pro.pojo.JsCourseRecord;
import com.pro.pojo.JsUserCoupon;
import com.pro.pojo.JsUserCouponUsed;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;

public interface JsCouponsMapper {
    //查看优惠券模糊查
    public List<JsUserCoupon> selectCoupons(
            @Param("couponName") String couponName,
            @Param("online") String online,
            @Param("grant") String grant,
            @Param("startDate") String startDate,
            @Param("endDate") String endDate,
            @Param("limit") Integer limit,
            @Param("page") Integer page
    );
    public Integer countCoupons(
            @Param("couponName") String couponName,
            @Param("online") String online,
            @Param("grant") String grant,
            @Param("startDate") String startDate,
            @Param("endDate") String endDate
    );

    //通过id查看优惠券详情
    public JsUserCoupon selectCouponById(Integer couponId);

    //删除优惠券
    public Boolean deleteCoupon(Integer couponId);
    //修改优惠券状态
    public Boolean updateCoupon(Integer couponId, Integer online, Integer updateId, String updateDate);
    //添加优惠券
    public Boolean addCoupns(JsUserCoupon jsUserCoupon);

    //查询用户优惠券
    public List<JsUserCoupon> selectUserCoupons(
            @Param("account") String account,
            @Param("nickname") String nickname,
            @Param("endDate") String endDate,
            @Param("limit") Integer limit,
            @Param("page") Integer page
    );
    public Integer countUserCoupons(@Param("account") String account,@Param("nickname") String nickname,@Param("endDate") String endDate);

    //查看所有优惠券
    public List<JsUserCoupon> selectGiveCoupons(
            @Param("couponName") String couponName,
            @Param("limit") Integer limit,
            @Param("page") Integer page);
    public Integer countGiveCoupons(String couponName);

    //为所有前台用户添加优惠券
    public Boolean addBeforeCoupons(List<JsUserCouponUsed> jsUserCouponUsed);
}
